set_property(GLOBAL PROPERTY USE_FOLDERS On)
cmake_minimum_required(VERSION 3.19)
project(CertificateTool)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

if(CMAKE_CONFIGURATION_TYPES)
    set(CMAKE_CONFIGURATION_TYPES RelWithDebInfo)
    set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "设置编译模式为RelWithDebInfo" FORCE)
endif()

# 默认存放静态库的文件夹位置
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_SOURCE_DIR}/lib)
# 默认存放动态库的文件夹位置
# set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/../bin)
# 存放可执行软件的目录
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_SOURCE_DIR}/bin)
# 默认存放库文件的位置，如果产生的是静态库并且没有指定 CMAKE_ARCHIVE_OUTPUT_DIRECTORY 则存放在该目录下，动态库也类似
#set(LIBRARY_OUTPUT_PATH_DEBUG ${CMAKE_SOURCE_DIR}/../lib)
# 使用系统环境变量，设置QtDir
message("QTDIR:$ENV{QTDIR}")
set(CMAKE_PREFIX_PATH $ENV{QTDIR})
set(QT_VERSION 6)
set(CMAKE_DEBUG_POSTFIX d)

include_directories(
    3rd/include
	include
)

link_directories(${PROJECT_SOURCE_DIR}/3rd/lib)

# ui文件单独存放
set(CMAKE_AUTOUIC_SEARCH_PATHS ${PROJECT_SOURCE_DIR}/forms)
add_executable(${PROJECT_NAME}
	src/main.cpp
		forms/CertificateTool.ui
        src/main.cpp src/CertificateTool.cpp include/CertificateTool.h)


set(REQUIRED_LIBS Core Gui Widgets)
set(REQUIRED_LIBS_QUALIFIED Qt6::Core Qt6::Gui Qt6::Widgets)
target_link_libraries(${PROJECT_NAME}
	libcrypto
	libssl
	wbemuuid
)

include(Qt5Config.cmake)




